#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
using namespace std;

struct TreeNode 
{
	int val;
	struct TreeNode* left;
	struct TreeNode* right;
	TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
};

typedef struct TreeNode TreeNode;

//class Solution 
//{
//public:
//	int sumTreeleft(TreeNode* root, int k)
//	{
//		if (root == nullptr)
//		{
//			return 0;
//		}
//		if (root->left == nullptr && root->right == nullptr && k != 0)
//		{
//			return root->val;
//		}
//		return sumTreeleft(root->left, 1) + sumTreeleft(root->right, 0);
//	}
//    int sumOfLeftLeaves(TreeNode* root) 
//    {
//		if (root == nullptr)
//		{
//			return 0;
//		}
//		else
//		{
//			return sumTreeleft(root, 0);
//		}
//    }
//};

//class Solution {
//public:
//	bool isSameTree(TreeNode* root,  TreeNode* subtree)
//	{
//		if (root == nullptr && subtree == nullptr)
//		{
//			return true;
//		}
//		if (root == nullptr)
//		{
//			return false;
//		}
//		if (subtree == nullptr)
//		{
//			return false;
//		}
//		if (root->val != subtree->val)
//		{
//			return false;
//		}
//		return isSameTree(root->left, subtree->left) && isSameTree(root->right, subtree->right);
//	}
//
//	bool isSubtree(TreeNode* root, TreeNode* subRoot)
//	{
//		if (root == nullptr && subRoot == nullptr)
//		{
//			return true;
//		}
//		if (root == nullptr)
//		{
//			return false;
//		}
//		if (isSameTree(root, subRoot))
//		{
//			return true;
//		}
//
//		return isSubtree(root->left, subRoot) || isSubtree(root->right, subRoot);
//    }
//};



struct ListNode 
{
	int val;
	struct ListNode *next;
	ListNode(int x) : val(x), next(nullptr) {}
};

typedef struct ListNode ListNode;

class Solution {
public:
   
    bool chkPalindrome(ListNode* A) 
	{
		if (A == nullptr)
		{
			return true;
		}
		ListNode* fast = A->next, * slow = A, * cur = nullptr, * prew = A;
		while (fast == nullptr && fast->next != nullptr)
		{
			fast = fast->next->next;
			prew = slow->next;
			slow->next = cur;
			cur = slow;
			slow = prew;
		}
		if (fast != nullptr)
		{
			ListNode* phead = prew->next;
			slow->next = cur;
			while (slow != nullptr)
			{
				if (slow->val != phead->val)
				{
					return false;
				}
				phead = phead->next;
				slow = slow->next;
			}
			return true;
		}
		else
		{
			ListNode* phead = prew->next;
			while (cur != nullptr)
			{
				if (phead->val != cur->val)
				{
					return false;
				}
				cur = cur->next;
				phead = phead->next;
			}
			return true;
		}
    }
};

using namespace std;

void Sort1(int* arr, int left, int right, int* a)
{
	if (left == right)
	{
		return;
	}
	int mid = (left + right) / 2, i = left;
	Sort1(arr, left, mid, a);
	Sort1(arr, mid + 1, right, a);

	int begin1 = left, end1 = mid;
	int begin2 = end1 + 1, end2 = right;
	while (begin1 <= end1 && begin2 <= end2)
	{
		if (arr[begin1] <= arr[begin2])
		{
			a[i++] = arr[begin1++];
		}
		else
		{
			a[i++] = arr[begin2++];
		}
	}
	while (begin1 <= end1)
	{
		a[i++] = arr[begin1++];
	}
	while (begin2 <= end2)
	{
		a[i++] = arr[begin2++];
	}
	memcpy(arr + left, a + left, sizeof(int) * (right - left + 1));
}

void Sort(int* arr, int len)
{
	int* a = (int*)malloc(sizeof(int) * len);
	Sort1(arr, 0, len - 1, a);
	free(a);
	a = nullptr;
}

int main() {
	int n;
	cin >> n;
	int* arr = (int*)malloc(sizeof(int) * n);
	for (int i = 0; i < n; i++)
	{
		cin >> arr[i];
	}
	Sort(arr, n);
	for (int i = 0; i < n; i++)
	{
		cout << arr[i] << ' ';
	}
	cout << endl;
}
